<template>
  <div class="selectedcolumn_container">
    <div class="selectedcolumn_header">严选专栏</div>
    <div
      class="selectedcolumn_img"
      v-for="(item, index) in getnewsList"
      :key="index"
      @click="onClick(item.id)"
    >
      <div>
        <img :src="item.pic" />
        <div class="item_text_container">
          <p>{{ item.title }}</p>
          <p>{{ item.descript }}</p>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      getnewsList: [],
    };
  },
  mounted() {
    this.$API.getnewsList().then((res) => {
      console.log(res.data.data);
      this.getnewsList = res.data.data;
    });
  },
  methods: {
    onClick(id) {
      this.$router.push({
        path: "/Finedetails",
        query: {
          id:id,
        },
      });
    },
  },
};
</script>
<style  >
.selectedcolumn_container {
  width: 100%;
}
.selectedcolumn_header {
  width: 100%;
  height: 0.8rem;
  background-color: cornsilk;
  display: flex;
  align-items: center;
  justify-content: center;
}
.selectedcolumn_img {
  width: 100%;
  height: 5rem;
  margin: 20px 0;
  position: relative;
  
}
.selectedcolumn_img img {
  width: 100%;
  height: 100%;
}
.item_text_container {
  width: 100%;
  position: absolute;
  top: 0;
  color: white;
}
.item_text_container p {
  width: 100%;
  height: 1rem;
  text-align: center;
  line-height: 1rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
</style>